# 做一个画板，按r键将画笔颜色更改为红色
# 按g键将画笔更改为绿色
# 按w键将画笔抬起
# 按s键将画笔落下
# 当鼠标左键点击在移动到该位置
import turtle
import random
def press_r():
    print("按下了R")
    turtle.pencolor("red")
def press_g():
    print("按下了G")
    turtle.pencolor("green")
def press_w():
    print("按下了W")
    turtle.penup()
def press_s():
    print("按下了S")
    turtle.pendown()
def click(x,y):
    print("按下鼠标")
    turtle.goto(x,y)
turtle.onkeypress(press_r,'r')
turtle.onkeypress(press_g,'g')
turtle.onkeypress(press_w,'w')
turtle.onkeypress(press_s,'s')
turtle.onscreenclick(click,1)

turtle.listen()
turtle.done()

